<?php

session_start();
include("../includes/conn.php");
$tools=new tools();
$adminid=intval($_SESSION['adminid']);
$type=isset($_POST['type'])?$_POST['type']:0;
$before=isset($_POST['before'])?$_POST['before']:1;
$after=isset($_POST['after'])?$_POST['after']:1;

if($type==1)//导购员
{
	$result = $dbconn->noretquery("update ".DBQIAN."fwm set 
	   credit=$after
	    where credit=$before and status=0");
	if ($result)
	{
		$dbconn->showalert("保存成功","hongbao.config.php",1);
	}
}
else //消费者
{
	$result = $dbconn->noretquery("update ".DBQIAN."fwm set 
	   usercredit=$after 
	    where usercredit=$before and userstatus=0");
	if ($result)
	{
		$dbconn->showalert("保存成功","hongbao.config.php",1);
	}
}
?>